package com.kefu.sys.mapper;

import com.kefu.common.mybatis.KefuMapper;
import com.kefu.sys.model.SysTenant;
import com.kefu.sys.vo.SysTenantRechargeVo;
import org.apache.ibatis.annotations.Update;

public interface SysTenantMapper extends KefuMapper<SysTenant> {
    @Update("update sys_tenant set tenant_status = 0 where tenant_id = #{id}")
    void updateStatusById(String id);

    @Update("update sys_tenant set available_call_count = COALESCE(available_call_count, 0) + #{availableCallCount} where tenant_id = #{tenantId}")
    void recharge(SysTenantRechargeVo sysTenantVo);
}